package dbPicasso::Plugin::Test;

use base qw(dbPicasso::Plugin);
use Data::Dumper;


sub init
{
	my $class = shift;

	my $name = 'TestPlugin';

	my $self = $class->SUPER::init(@_);
	$self = bless $self, $class;

	#$self->SUPER::register('on_app_start', \&on_app_start, [ 'codeVBox' ]);
	#$self->SUPER::register('on_app_shutdown', \&on_app_shutdown, [ 'ConnectionName' ]);
	#$self->SUPER::register('before_query', \&before_query, [ 'codeVBox' ]);
	#$self->SUPER::register('after_query', \&after_query, [ 'codeVBox' ]);
	#$self->SUPER::register('before_connect', \&before_connect, [ 'codeVBox' ]);
	#$self->SUPER::register('after_connect', \&after_connect, [ 'codeVBox' ]);

	return $self;
}

sub on_app_start
{
	print "App Start Event Fired!\n";
	print "Arguments: " . Dumper(\@_);

	my $self = shift;

	$$self{AppStart} = 1;

	print "Leaving on_app_start with self of: " . Dumper($self);
}

sub before_query	
{
	print "Before query event fired!\n";
	print "Arguments: " . Dumper(\@_);

	my $self = shift;
	my $widgets = shift;

	$$self{query} = shift;

	print "Leaving before_query with self of: " . Dumper($self);

}

sub after_query
{
	my $self = shift;

	print "After query event fired\n";
	print "Arguments: " . Dumper(\@_);

	print "After query, self looks like: " . Dumper($self);
}


sub before_connect	
{
	print "Before connect event fired!\n";
	print "Arguments: " . Dumper(\@_);
}

sub after_connect
{
	print "After connect event fired\n";
	print "Arguments: " . Dumper(\@_);
}

sub on_app_shutdown
{
	print "App shutdown event fired!\n";
	print "Arguments: " . Dumper(\@_);
}

1;
